package config

import (
	"github.com/joho/godotenv"
	"log"
	"lowcode_deployment/pkg/timer"
	"os"
)

var ENV map[string]string

func Bootstrap(envPath string) {
	// 设置时区
	timer.SetTimezonePRC()

	// 加载env
	if envPath == "" {
		envPath = os.Getenv("GOPATH") + "/src/lowcode_deployment/.env"
	}

	var err error
	ENV, err = godotenv.Read(envPath)
	log.Printf(".env file: %s", envPath)
	if err != nil {
		log.Printf("Error loading .env file: %s ", envPath)
	}

}
